﻿using Common.Data.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataCenter.Configuration;
using DataCenter.Model.Model;

namespace DataCenter.Data.DBConfig
{
    public class WarrantyMasterConfiguration : DBConfig<WarrantyMaster>
    {
        public WarrantyMasterConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.SerialNo, k.Model, k.ShopCode });
            Property(c => c.IncentiveCfmFlag).HasMaxLength(1);
            Property(c => c.CloseFlag).HasMaxLength(1);
            Property(c => c.SmsYn).HasMaxLength(1);
            Property(c => c.SoTransferFlag).HasMaxLength(1);              
            Property(c => c.SerialNo).HasMaxLength(50).IsRequired(); 
            Property(c => c.Model).HasMaxLength(100).IsRequired();
            Property(c => c.ShopCode).IsRequired(); 
            Property(c => c.SelloutTime).HasMaxLength(8);
        }
    }
}
